<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <!-- <title value="advice_frm">弃单原因</title> -->
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../css/main.css" />
    <style type="text/css">
        body {
            background: rgba(190, 190, 190, 0.2);
        }

        .big-box {
            background: #fff;
            border-radius: 20px;
            width: 225px;
            height: 230px;
            position: absolute;
            left: 50%;
            top: 290px;
            /*top: 50%;*/
            transform: translate(-50%, -50%);
            padding-top: 15px;
        }

        .test {
            position: relative;
        }

        .img_00 {
            position: absolute;
            top: 49.5%;
            right: 48%;
            margin-top: -138px;
            margin-right: -115px;
            width: 23px;
        }

        .phone_login {
            margin: 15px 15px;
            border-radius: 8px;
            background-color: #fff;
            color: #EA5413;
            border: 1px solid #EA5413;
            font-size: 12px;
            text-align: center;
            height: 35px;
            line-height: 35px;
        }

        .password_login {
            margin: 15px 15px;
            border-radius: 8px;
            background-color: #fff;
            color: #EA5413;
            border: 1px solid #EA5413;
            font-size: 12px;
            text-align: center;
            height: 35px;
            line-height: 35px;
        }

        .register {
            margin: 15px 15px;
            border-radius: 8px;
            background-color: #EA5413;
            color: white;
            font-size: 12px;
            text-align: center;
            height: 35px;
            line-height: 35px;
        }

        .line {
            width: 27px;
            height: 2px;
            background-color: #EA5413;
            position: absolute;
            top: 50%;
            right: 50%;
            margin-top: 96px;
            margin-right: 70px;
        }

        .line1 {
            width: 27px;
            height: 2px;
            background-color: #EA5413;
            position: absolute;
            top: 50%;
            right: 50%;
            margin-top: 96px;
            margin-right: -98px;
        }

        .img_chart {
            position: absolute;
            top: 50%;
            right: 50%;
            margin-top: 78px;
            margin-right: 27px;
            width: 35px;
        }

        .img_QQ {
            position: absolute;
            top: 50%;
            right: 50%;
            margin-top: 79px;
            margin-right: -20px;
            width: 33px;
        }

        .img_weibo {
            position: absolute;
            top: 50%;
            right: 50%;
            margin-top: 78px;
            margin-right: -65px;
            width: 35px;
        }
    </style>
</head>

<body>
    <div class="big-box test">
        <img src="../../image/my/guanbi.png" alt="" class="img_00" onclick="Opencancel()">
        <div style="text-align:center;color:black;font-size:13px;padding-top:5px;">为了您的账户安全，请登录</div>
        <div class="register" onclick="register_code()">新人注册</div>
        <div class="password_login" onclick="Password_login()">密码登录</div>
        <div class="phone_login" onclick="Phone_login()">手机登录</div>
        <!-- <div class="line"></div>
        <div class="line1"></div>
        <img src="../../image/my/chart.png" alt="" class="img_chart" onclick="wechatlogin()">
        <img src="../../image/my/QQ.png" alt="" class="img_QQ" onclick="qqlogin()">
        <img src="../../image/my/weibo.png" alt="" class="img_weibo" onclick="weibologin()"> -->
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/zepto.js"></script>
<script type="text/javascript" src="../../script/thirdparty.js"></script>
<script type="text/javascript" src="../../script/config.js"></script>
<script type="text/javascript" src="../../script/rest.js"></script>
<script type="text/javascript" src="../../script/faskclick.js"></script>
<script type="text/javascript" src="../../script/jiguang.js"></script>
<script type="text/javascript">
    function Opencancel() {
        // api.closeFrame();
        // alert(api.pageParam.value)
        if (api.pageParam.value==1) {
            api.sendEvent({
                name: 'playvideoad'
            });
            setTimeout(function() {
              api.closeFrame();
            }, 200)
        }else {
            api.sendEvent({
                name: 'bofang'
            });
            setTimeout(function() {
              api.closeFrame();
            }, 200)
        }
    }

    function register_code() {
        api.openWin({
            name: 'register_code',
            url: '../login/register-codewin.html',
            reload: true

        });
        setTimeout(function() {
            api.closeFrame();
        }, 200)
    }

    function Phone_login() {
        api.openWin({
            name: 'rapidenrollment',
            url: '../login/rapid-enrollment.html',

        });
        setTimeout(function() {
            api.closeFrame();
        }, 200)
    }

    function Password_login() {
        api.openWin({
            name: 'pawwordlogin',
            url: '../login/rapid-pawword.html',
        });
        setTimeout(function() {
            api.closeFrame();
        }, 200)
    }
    var isbdmobileflag;

    function wechatlogin() {
        third.auth('wx', function(res, third, thirdopenid, uname) {
            // alert(JSON.stringify(res))
            if (res.flag == 1) {
                if (res.msg) {
                  thirdlogin1(third, thirdopenid)

                } else {
                    api.openWin({
                        name: 'verifyrepirthird',
                        url: '../login/verify-repirthird.html',
                        pageParam: {
                            third: third,
                            thirdopenid: thirdopenid,
                            uname: uname
                        }
                    });
                    setTimeout(function() {
                        api.closeFrame();
                    }, 2000)
                }
            }
        }, true)
    }


    function qqlogin() {
        third.auth('qq', function(res, third, thirdopenid, uname) {
            if (res.flag == 1) {
                if (res.msg) {
                    thirdlogin1(third, thirdopenid)
                } else {
                    api.openWin({
                        name: 'verifyrepirthird',
                        url: '../login/verify-repirthird.html',
                        pageParam: {
                            third: third,
                            thirdopenid: thirdopenid,
                            uname: uname

                        }
                    });
                    setTimeout(function() {
                        api.closeFrame();
                    }, 2000)
                }
            }
        }, true)
    }

    function weibologin() {
        third.auth('weibo', function(res, third, thirdopenid, uname) {
            // alert(uname)
            // alert(JSON.stringify(res))
            if (res.flag == 1) {
                if (res.msg) {
                  thirdlogin1(third, thirdopenid)
                } else {
                    api.openWin({
                        name: 'verifyrepirthird',
                        url: '../login/verify-repirthird.html',
                        pageParam: {
                            third: third,
                            thirdopenid: thirdopenid,
                            uname: uname

                        }
                    });
                    setTimeout(function() {
                        api.closeFrame();
                    }, 2000)
                }
            }
        }, true)
    }

    function thirdlogin1(third, restopenid) {
        var data = {};
        var deviceId = api.deviceId;
        data['device_id'] = deviceId;
        data[third] = restopenid
        new rest().get('loginThird').datae(data).success(function(res) {
            if (res.flag == 1) {
                loginafter(res.msg.uid, res.msg.session)
            }
        }).error(function(err) {
            api.toast({
                msg: err.msg,
                duration: 2000,
                location: 'center'
            });
        }).run()
    }

    function loginafter(uid, session) {
      jiguang.bingdalias(uid)
        $api.setStorage('uid', uid);
        $api.setStorage('session', session);
        api.sendEvent({
            name: 'loginsuccess',
        });
        api.closeFrame();

        // setTimeout(function() {
        // }, 500)

    }
</script>

</html>
